//
//  AppDelegate.m
//  TintExample
//
//  Created by Kevin Wu on 8/31/12.
//  Copyright (c) 2012 Telligenty. All rights reserved.
//

#import "AppDelegate.h"
#import "TEMainViewController.h"

@implementation AppDelegate

- (UIViewController *)newViewController
{
    TEMainViewController *vc = [[TEMainViewController alloc] init];
    UINavigationController *nv = [[UINavigationController alloc] initWithRootViewController:vc];
    TTRelease(vc);
    return nv;
}

- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
    [super application:application didFinishLaunchingWithOptions:launchOptions];
    
    if ( TTIsFirstLaunch() ) {
        NSLog(@"first");
    } else {
        NSLog(@"not first");
    }
    
    [self willCreateWindow];
    
    UIWindow *newWindow = [self newWindow];
    self.window = newWindow;
    TTRelease(newWindow);
    
    UIViewController *newViewController = [self newViewController];
    self.window.rootViewController = newViewController;
    TTRelease(newViewController);
    
    [self.window makeKeyAndVisible];
    
    [self didCreateWindow];
    
    
    return YES;
}

@end
